<?php
/*=====================================================
 Copyright (C) ETERNAL<iqstar@ms24.hinet.net>
 URL : http://www.et99.net

请仔细阅读以下许可协议。当您使用本软体，您将自动成为本协议的一方并受到本协议的约束。

软体和文档受到台湾及中国大陆著作权法及国际条约的保护。您不得：
a)营利、出租或者出借软体或文档的任何部分。
b)反向工程、分解、反编译或者企图察看软体的源代码作为商业用途。
c)修改或者改变软体，或者与其他程式结合。

许可人保留软体及文档的所有权利和权益。您不能通过本许可协定获得软体的任何所有权和知识产权。
===================================================== */
if ($_COOKIE["wog_cookie_name"] == "" || !isset($_COOKIE["wog_cookie_name"])) {
    exit;
} else {
    $user = $_COOKIE["wog_cookie_name"];
}

require_once("./class/chat_class.php");
$chat_class = new chat_class;
//setcookie("wog-name",$_GET["user_id"]);
require_once './../wog_act_config.php';

?>
<!DOCTYPE HTML>
<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
    <link rel="stylesheet" href="./../css/wog_infinity/main.css?t=<?= $wog_array['ASSETS_TIME'] ?>">
    <script language="JavaScript">
        <?php
        echo "parent.lastspeed=" . $chat_class->get_speed() . ";\n";
        unset($chat_class);
        ?>
        function stype() {
            return parent.lastspeed;
        }

        function chatdate() {
            var towho = parent.parent.parent.get_towho();
            var f_chat = document.f1;
            if (f_chat.chat_type.value == "4" && towho == "") {
                return false;
            }
            if (parent.set_lock1 == 1 && f_chat.chat_type.value == "1") {
                return false;
            }
            if (parent.set_lock2 == 1 && f_chat.chat_type.value == "4") {
                return false;
            }
            if (parent.set_lock3 == 1 && f_chat.chat_type.value == "2") {
                return false;
            }
            if (parent.set_lock4 == 1 && f_chat.chat_type.value == "3") {
                return false;
            }
            if (f_chat.chat_temp.value != "") {
                f_chat.lastspeed.value = stype();
                f_chat.towhos.value = towho;
                f_chat.chat_body.value = document.f1.chat_temp.value;
                f_chat.item_id.value = document.f1.item_id_temp.value;
                f_chat.chat_temp.value = "";
                f_chat.item_id_temp.value = "";
                return true;
            }
            return false;
        }
    </script>
</head>

<body>
<form action="wog_chat_hidden.php" method="post" name="f1" target="chat_list" onSubmit="return(chatdate())">
    <input type="submit" name="send" value="送出">
    <input type="text" size="30" maxlength="250" name="chat_temp">
    <select name="chat_type" onchange="document.f1.chat_temp.focus()">
        <option value="1" SELECTED>一般频</option>
        <option value="4">私频</option>
        <option value="2">公会频</option>
        <option value="3">队频</option>
    </select>
    <input type="button" value="频道设定" onclick="parent.chat_set();">
    <input type="hidden" name="lastspeed" value="">
    <input type="hidden" name="towhos" value="">
    <input type="hidden" name="chat_body" value="">
    <input type="hidden" name="set_lock1" value="">
    <input type="hidden" name="set_lock2" value="">
    <input type="hidden" name="set_lock3" value="">
    <input type="hidden" name="set_lock4" value="">
    <input type="hidden" name="item_id_temp" value="">
    <input type="hidden" name="item_id" value="">
</form>
</body>
<script>
    parent.message_cls(parent.chat_view);
    parent.goldset('系统', '0', '<font class="text-danger">' + parent.well_box[Math.floor(Math.random() * parent.well_box.length)] + '</font>', '', '');
    <?php
    echo "parent.chat_list.document.location=\"wog_chat_list.php?lastspeed=\"+parent.lastspeed;";
    ?>
</script>
</html>
